﻿class Solution {
public:
    string removeDuplicates(string s) {
        string ret;
        for (int i = 0; i < s.size(); i++)
        {
            if (ret.size() == 0) ret += s[i];
            else {
                if (ret.back() == s[i]) ret.pop_back();
                else ret += s[i];
            }
        }
        return ret;
    }
};